package cn.openea.perpartner.expert.web.controller;

import cn.openea.perpartner.common.core.web.controller.BaseController;
import cn.openea.perpartner.common.core.web.domain.AjaxResult;
import cn.openea.perpartner.expert.web.domain.dto.DeliveryDto;
import cn.openea.perpartner.expert.web.service.IDeliveryService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Weird077
 * @description TODO
 * @date 2023-06-27 11:15
 */
@RestController
@RequestMapping("expert/delivery")
public class DeliveryController extends BaseController {
    @Resource
    private IDeliveryService deliveryService;


    @PostMapping("/detail")
    public AjaxResult selectDeliveryDetail(@RequestBody DeliveryDto dto) {
        return  deliveryService.selectDeliveryDetail(dto);
    }
    @PostMapping("/submit/partner")
    public AjaxResult partnerSubmitResult(@RequestBody DeliveryDto dto) {
        return deliveryService.partnerSubmitResult(dto) ? success() : error();
    }

    @PostMapping("/verify/user")
    public AjaxResult userVerifyResult(@RequestBody DeliveryDto dto) {
        return deliveryService.userVerifyResult(dto) ? success() : error();
    }

    @PostMapping("/reject/user")
    public AjaxResult rejectResult(@RequestBody DeliveryDto dto) {
        return deliveryService.rejectResult(dto) ? success() : error();
    }
}
